jQuery(document).ready(function()
{		
	//viewport buttons
	jQuery(".viewport ul li").on("click", function() 
	{
		jQuery(".viewport ul li").removeClass("selected");
		jQuery(this).addClass("selected");
		jQuery("#viewport").attr("class", 'viewport_' + this.id);
		if (this.id == 'tablet') setTimeout('jQuery("body").css("overflow", "auto")', 1000); else setTimeout('jQuery("body").css("overflow", "hidden")', 500);
	});
	
	$('.theme').dropkick({width:180});
	
	var timeout;
		jQuery(document).ready(function () {
		jQuery("#theme-selector .dk_options li").hover(
			function()
			{
				var $this = jQuery('a',this);
				jQuery("#preview img").attr("src", $this.attr("imagepreview"));
				jQuery("#preview").stop().css("display", "block").animate({opacity:1}, 500);
				clearTimeout(timeout);
			}, 
			function() 
			{
				timeout = setTimeout('jQuery("#preview").stop().animate({opacity:0}, 500, function() { jQuery("#preview").css("display", "none"); })', 1000);
			}).click(function () 
			{
				var $this = jQuery('a',this);
				document.title = $this.attr("name");
				jQuery("#website").attr("src", $this.attr("url"));;
				jQuery("#purchase").attr("href", $this.attr("buyurl"));;
				jQuery("#close").attr("href", $this.attr("url"));;
			});
		});

});	
